// 百度地图API功能
var map = new BMap.Map("map");
var point = new BMap.Point(116.331398,39.897445);
map.centerAndZoom(point,12);
// 创建地址解析器实例
var myGeo = new BMap.Geocoder();
// 将地址解析结果显示在地图上,并调整地图视野
var add = address;

myGeo.getPoint(add, function(point){

    if (point) {
        var label = new BMap.Label(add, {position : point,offset: new BMap.Size(20, -25)});
        label.setStyle({
            color : "black",
            fontSize : "12px",
            height : "20px",
            lineHeight : "20px",
            fontFamily:"微软雅黑",
            marginTop:"-10px",
            padding:"3px",

        });
        map.addOverlay(label);                 //开启信息窗口
        map.centerAndZoom(point, 18);
        map.addOverlay(new BMap.Marker(point));
    }else{
        alert("您选择地址没有解析到结果!");
    }
}, "广东省");
